package org.act.xservices.rt.xcontainer.adaptation.worker;

import org.act.xservices.rt.xcontainer.adaptation.handler.AdaptationHandler;
import org.act.xservices.rt.xcontainer.framework.IConnector;
import org.act.xservices.rt.xcontainer.framework.dispatcher.ADispatchWorkerFactory;
import org.act.xservices.rt.xcontainer.framework.dispatcher.ISafeDispatchWorker;
import org.act.xservices.rt.xcontainer.inf.context.IServiceContext;


/**
 * @LastModifyTime 2008-7-7
 * @CreationTime 2007-06-20
 * @author Lizq [lizq@act.buaa.edu.cn]
 * @since JDK1.5
 */
public class AdaptationInWorkerFactory extends ADispatchWorkerFactory<IServiceContext> {

	
	private AdaptationHandler adaptationHandler;
	
	
	public AdaptationInWorkerFactory(IConnector connector){
		super(connector);
	}
	
	
	
	
	@SuppressWarnings("unchecked")
	@Override
	public final ISafeDispatchWorker createSafeDispatchWorker(IServiceContext serviceContext) {
		// TODO Auto-generated method stub
		AdaptationInWorker adaptationInWorker = 
			new AdaptationInWorker(this.getConnector());
		adaptationInWorker.setAdaptationHandler(adaptationHandler);
		adaptationInWorker.setServiceContext(serviceContext);		
		return adaptationInWorker;
	}

	public AdaptationHandler getAdaptationHandler() {
		return adaptationHandler;
	}




	public void setAdaptationHandler(AdaptationHandler adaptationHandler) {
		this.adaptationHandler = adaptationHandler;
	}

}
